package com.education.db.domain;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by Fan307 on 2016/11/17.
 */
@Entity
@Table(name = "info_file", schema = "db_education", catalog = "")
public class InfoFile {
    private int fileId;
    private String fileName;
    private String fileUpdater;
    private String filePath;
    private Timestamp fileDate;

    @Id
    @Column(name = "file_id")
    public int getFileId() {
        return fileId;
    }

    public void setFileId(int fileId) {
        this.fileId = fileId;
    }

    @Basic
    @Column(name = "file_name")
    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    @Basic
    @Column(name = "file_updater")
    public String getFileUpdater() {
        return fileUpdater;
    }

    public void setFileUpdater(String fileUpdater) {
        this.fileUpdater = fileUpdater;
    }

    @Basic
    @Column(name = "file_path")
    public String getFilePath() {
        return filePath;
    }

    public void setFilePath(String filePath) {
        this.filePath = filePath;
    }

    @Basic
    @Column(name = "file_date")
    public Timestamp getFileDate() {
        return fileDate;
    }

    public void setFileDate(Timestamp fileDate) {
        this.fileDate = fileDate;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        InfoFile infoFile = (InfoFile) o;

        if (fileId != infoFile.fileId) return false;
        if (fileName != null ? !fileName.equals(infoFile.fileName) : infoFile.fileName != null) return false;
        if (fileUpdater != null ? !fileUpdater.equals(infoFile.fileUpdater) : infoFile.fileUpdater != null)
            return false;
        if (filePath != null ? !filePath.equals(infoFile.filePath) : infoFile.filePath != null) return false;
        if (fileDate != null ? !fileDate.equals(infoFile.fileDate) : infoFile.fileDate != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = fileId;
        result = 31 * result + (fileName != null ? fileName.hashCode() : 0);
        result = 31 * result + (fileUpdater != null ? fileUpdater.hashCode() : 0);
        result = 31 * result + (filePath != null ? filePath.hashCode() : 0);
        result = 31 * result + (fileDate != null ? fileDate.hashCode() : 0);
        return result;
    }
}
